<template>
  <div class="about memberBg">
    <!-- 头部 -->
    <InsideHeader></InsideHeader>

    <!-- memberElearning -->
    <div class="memberElearning memberBg">
      <div class="memberBlock">
        <div class="memberIndexN">
          <div class="memberIndexNC">
            <nuxt-link :to="{name: 'member'}">个人信息</nuxt-link>
            <nuxt-link :to="{name: 'member-memberInquiry'}">我的问询</nuxt-link>
            <nuxt-link :to="{name: 'member-memberElearning'}" class="on">我的elearning</nuxt-link>
            <nuxt-link :to="{name: 'member-collect'}">我的收藏</nuxt-link>
            <nuxt-link :to="{name: 'member-message'}">系统消息</nuxt-link>
            <div class="clear"></div>
          </div>
          <div class="clear"></div>
        </div>
        <div class="memberElearningC">
          <div class="memberInquiryDetailsCtit">
            <em></em>
            <p>我的elearning</p>
          </div>
          <ul class="memberElearningCS">
            <li v-for="(item,index) in datalist" :key="index">
              <img :src="item.mainPhoto" />
              <div class="elinfo">
                <h3>{{item.trainingCourseVo.courseName}}</h3>
                <p>成绩：{{item.score}}</p>
                <p>上次学习的章节：{{item.lastChapterName}}</p>
                <p>上次学习的时间：{{item.lastStudyTime}}</p>
                <a
                  :href="'http://47.101.53.144:5679/1007/html/index/frameset.html?userOid=123&courseOid='+item.oid"
                >继续学习</a>
              </div>
            </li>
          </ul>
          <p v-if="datalist.length==0" class="nodata">暂无数据</p>
        </div>
      </div>
    </div>
    <!-- 底部 -->
    <HomeHooter></HomeHooter>
  </div>
</template>

<script>
import $ from "jquery";
import "@/assets/css/home.css";
import "@/assets/css/member.css";
import InsideHeader from "@/components/headuser";
import HomeHooter from "@/components/footer";
import Qs from "qs";
export default {
  name: "memberInquiry",
  data() {
    return {
      datalist: [],
      userinfo: ""
    };
  },
  components: {
    InsideHeader,
    HomeHooter
  },
  methods: {
    getcouserlist() {
      let id = this.$axios;
      let params = Qs.stringify({
        page: this.page,
        limit: 10,
        createBy: this.userInfo
      });
      this.$api.member.getTrainingPage(id, params).then(res => {
        let result = res.data;
        if (result.code === 1) {
          this.datalist = result.data.data;
        }
      });
    }
  },
  mounted() {
    var userinfo;
    let _this = this;
    if (window) {
      userinfo = window.sessionStorage.getItem("userInfo");
    }
    if (userinfo) {
      this.userInfo = userinfo;
      this.getcouserlist();
    } else {
      _this.$router.push("/enroll");
    }
  }
};
</script>

<style scoped>
.memberElearningCS {
  margin-top: 20px;
  overflow: hidden;
}
.memberElearningCS li {
  width: 99.5%;
  border: solid 1px #ccc;
  overflow: hidden;
}
.memberElearningCS img {
  float: left;
  margin-right: 20px;
}
.memberElearningCS .elinfo {
  float: left;
}
.memberElearningCS h3 {
  font-size: 18px;
  margin: 40px 0 10px;
}
.memberElearningCS p {
  font-size: 14px;
  overflow: hidden;
}
.memberElearningCS a {
  color: #fff;
  padding: 10px 30px;
  background-color: #e70012;
  margin-top: 20px;
  display: inline-block;
}
</style>